﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _3_1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("欢迎来到我的代码！");
            short aShort = new short();//值定义类初始化
            byte aByte = new Byte();
            decimal aDecimal = 100.5m;
            char aChar = 'A';
            Console.WriteLine("值类型的初始化值：{0}，{1}，{2}，{3}", aShort, aByte, aDecimal, aChar);
            //值类型的赋值与操作
            float aFloat = 123.123F;
            bool aBool = ((aFloat > 121) && (aFloat < 125));
            if (aBool)
            {
                int aInteger;
                aInteger = (int)aFloat;//显示转换，将浮点型转化为整型
                double aDouble;
                aDouble = aFloat;//隐式转化，将浮点转换为双精度型
                Console.WriteLine("类型转化的结果:{0},{1}", aInteger, aDouble);
            }
            //枚举类型的使用
            long x = (long)Data.Min;
            long y = (long)Data.Max;
            Console.WriteLine("枚举类型的值:{0},{1}", x, y);
            //结构的使用
            MyPoint aPoint;
            aPoint.x = 10;
            aPoint.y = 100;
            Console.WriteLine("结构类型的值：{0},{1}", aPoint.x, aPoint.y);
            //布尔类型的计算
            bool BoolT = true;
            bool BoolF = false;
            Console.WriteLine("True && False is {0}", (BoolT & BoolF));
            Console.WriteLine("True && True is {0}", (BoolT & BoolT));
            Console.WriteLine("False && True is {0}", (BoolF & BoolT));
            Console.WriteLine("False && False is {0}", (BoolF & BoolF));
            Console.WriteLine("True || False is {0}", (BoolT & BoolF));
            Console.WriteLine("True || True is {0}", (BoolT & BoolT));
            Console.WriteLine("False || True is {0}", (BoolF & BoolT));
            Console.WriteLine("False || False is {0}", (BoolF & BoolF));
            Console.ReadKey();
        }
        enum Data : long { Min=255L,Mid=1024L,Max=32768L
        };
        public struct MyPoint
        {
            public int x, y;
            public MyPoint(int x, int y){
                this.x = x;
                this.y = y;
            }
        }
    }
}
